//
//  UserBSGetUploadVideoToken.m
//  Teacher
//
//  Created by 马腾飞 on 15/8/20.
//  Copyright (c) 2015年 xueyinyue. All rights reserved.
//

#import "UserBSGetUploadToken.h"
#import "ApiConfig.h"
#import "ApplicationContext.h"


@implementation UserBSGetUploadToken

- (id)onExecute
{
    //获取七牛token
    
    NSMutableDictionary *params = [[NSMutableDictionary alloc] init];
    id result = [self remoteJSON:@"POST" url:[ApiConfig urlApiGetQiNiuToken] params:params];
    
    
    UserBSGetUploadTokenResult *serviceResult = [[UserBSGetUploadTokenResult alloc] init];
    
    if ([result[@"status"] isEqualToString:@"0"])
    {
        NSLog(@"Get token success");
        serviceResult.token = result[@"data"][@"token"];
    }
    else
    {
        NSLog(@"Error status: %@",result[@"status"]);
    }
    
    
    return serviceResult;
}

@end

@implementation UserBSGetUploadTokenResult

@end